package com.tensquare.article.pojo;

import io.github.classgraph.json.Id;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author: xxx
 * @Date: 2022/10/26 20:45
 * @Description: mongoDB下的类
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="Comment对象", description="评论")
//注意 @Document 要加上，可能会遇到查询不到 重名等 集合要和mongodo的集合名称要一样。该大写就大写，该小写就小写
@Document("comment")
public class Comment implements Serializable {
    @ApiModelProperty(value = "_id")
    @Id
    private String _id;
    @ApiModelProperty(value = "文章id")
    private String articleid;
    @ApiModelProperty(value = "评论内容")
    private String content;
    @ApiModelProperty(value = "用户id")
    private String userid;
    @ApiModelProperty(value = "父子id")
    private String parentid;
    @ApiModelProperty(value = "日期")
    private Date publishadate;
    @ApiModelProperty(value = "点赞")
    private Integer  thumbup;
    
}
